﻿@page "/Pies/Basic"
@using LiveChartsCore
@using LiveChartsCore.SkiaSharpView.Blazor
@using LiveChartsCore.SkiaSharpView.Drawing.Geometries
@using LiveChartsCore.SkiaSharpView.Extensions
@using LiveChartsCore.SkiaSharpView.VisualElements
@using LiveChartsCore.SkiaSharpView.Painting
@using SkiaSharp

<PieChart
	Series="Series"
    Title="Title">
</PieChart>

@code {
    private ISeries[] Series { get; set; }
    private DrawnLabelVisual Title { get; set; }

    protected override void OnInitialized()
    {
        Series = new[] { 2, 4, 1, 4, 3 }.AsPieSeries();
        
        Title = new DrawnLabelVisual(
            new LabelGeometry
            {
                Text = "My chart title",
                TextSize = 25,
                Padding = new LiveChartsCore.Drawing.Padding(15),
                Paint = new SolidColorPaint(SKColors.Black)
            });
    }
}
